package efg.tasks;

import efg.SelfCheckableTask;
import efg.Track;
import efg.Train;

public class CheckSwitchScheduleTask extends SelfCheckableTask {

	private Train train;
	private Track track;
	
	public CheckSwitchScheduleTask(Train train, Track track) {
		super();
		this.train = train;
		this.track = track;
	}

	@Override
	public Boolean canExecute() {
		return(train.getCurrentPlace().equals(track));
	}

	@Override
	public void execute(Integer currentTime) {
		train.checkSwitchSchedule(track, currentTime);
	}

}
